<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>记账了</title>
<link rel="stylesheet" href="resources/css/style.css" type="text/css"
	media="all" />
<link href="resources/css/demo.css" type="text/css" rel="stylesheet" />
<link href="resources/css/custom.css" rel="stylesheet" />
<script src="resources/js/jquery-1.10.2.js"></script>
<script src="resources/js/jquery-ui-1.10.4.custom.js"></script>

<script>
$(document).ready(function(){
	if(${payType eq "收入"}){
		$("#income").attr("checked","checked");
	}else if(${payType eq "支出"}){
		$("#outlay").attr("checked","checked");
	}
	if($("#income").attr("checked")=="checked"){
		$("#title").text($("#income").val()+"记账");
	}
	if($("#outlay").attr("checked")=="checked"){
		$("#title").text($("#outlay").val()+"记账");
	}
	$("#income").click(function(){
		var val = $(this).val();
		$("#title").text(val+"记账");
	});
	$("#outlay").click(function(){
		var val = $(this).val();
		$("#title").text(val+"记账");
	}); 
	$(".info").fadeOut(8000);
});
</script>
<style>
.info{
	background-color:#FFEEAA;
	position: absolute;
	width:100px;
	height:30px;
	color: green;
	text-align:center;
	margin-top: 90px;
	margin-left:-60px;
	font-size: 20px;
	display: none;
}
.action {
	padding-left: 450px;
}

.p1 {
	color: red
}

.c1 {
	color: black;
	font-size: 20px;
	line-height: 2.5em;
	padding-left: 300px;
	width: 150px;
}
.c2 {
	color: black;
	font-size: 18px;
	padding-bottom:0px
}

.a1 {
	color: black;
	font-size: 25px;
	line-height: 2.5em;
	cursor: pointer;
	background-color: #EEEEEE;
}

.bton {
	color: block;
	font-size: 15px;
	margin-top: 20px;
	margin-left: 450px;
	cursor: pointer;
	background-color: #99AAff;
}
</style>
</head>
<body>
<div style="display:${display}" class="info">${message}</div>
	<div class="main">
		<div class="wraper">
			<h2 class="green" align="center" id="title">${payType}记账</h2>
			<form:form commandName="addForm" action="addItem">
		<table>
			<tr>
				<td class="c1">收支类型:</td>
				<td class="c2">收入: <form:radiobutton path="type" value="收入" id="income"/> 
				支出: <form:radiobutton path="type" value="支出" id="outlay"/>
				</td>
				<td><form:errors path="type" cssClass="p1" /></td>
			</tr>
			<tr>
			<td class="c1">账户:</td>
				<td class="c2">
				<form:select path="accountId">
					<c:forEach items="${accountList }" var="account">
						<form:option value="${account.id}">${account.account }</form:option>
					</c:forEach>
				</form:select></td>
				<td><form:errors path="accountId" cssClass="p1" /></td>
			</tr>
			<tr>
			<td class="c1">项目:</td>
				<td class="c2">
				<form:select path="item">
					<form:option value="蔬菜水果" />
					<form:option value="烟酒零食" />	
					<form:option value="水电煤气" />
					<form:option value="交伙食费" />
					<form:option value="其他项目" />
				</form:select></td>
				<td><form:errors path="item" cssClass="p1" /></td>
			</tr>
			<tr>
				<td class="c1">金额:</td>
				<td><form:input path="amount" /></td>
				<td class="p1"><form:errors path="amount" cssClass="p1" /></td>
			</tr>
			<tr>
			<td class="c1">成员:</td>
				<td class="c2">
					<form:select path="member" id="member">
						<form:options items="${memberList}"></form:options>
					</form:select></td>
				<td><form:errors path="member" cssClass="p1" /></td>
			</tr>
			<tr>
				<td class="c1">摘要:</td>
				<td><form:textarea path="summary" /></td>
			</tr>
			<tr >
				<td colspan="2">
					<input type="submit" value="提交" class="bton"/>
				</td>
			</tr>
		</table>
	</form:form>
			<h2 class="c2">&nbsp;</h2>
		</div>
	</div>
</body>
</html>
